package cn.r6b.user.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.r6b.user.mapper.UserTeacherMapper;
import cn.r6b.user.domain.UserTeacher;
import cn.r6b.user.service.IUserTeacherService;

/**
 * 老师Service业务层处理
 * 
 * @author mirai
 * @date 2023-01-31
 */
@Service
public class UserTeacherServiceImpl implements IUserTeacherService 
{
    @Autowired
    private UserTeacherMapper userTeacherMapper;

    /**
     * 查询老师
     * 
     * @param id 老师主键
     * @return 老师
     */
    @Override
    public UserTeacher selectUserTeacherById(Long id)
    {
        return userTeacherMapper.selectUserTeacherById(id);
    }

    /**
     * 查询老师列表
     * 
     * @param userTeacher 老师
     * @return 老师
     */
    @Override
    public List<UserTeacher> selectUserTeacherList(UserTeacher userTeacher)
    {
        return userTeacherMapper.selectUserTeacherList(userTeacher);
    }

    /**
     * 新增老师
     * 
     * @param userTeacher 老师
     * @return 结果
     */
    @Override
    public int insertUserTeacher(UserTeacher userTeacher)
    {
        userTeacher.setCreateTime(DateUtils.getNowDate());
        return userTeacherMapper.insertUserTeacher(userTeacher);
    }

    /**
     * 修改老师
     * 
     * @param userTeacher 老师
     * @return 结果
     */
    @Override
    public int updateUserTeacher(UserTeacher userTeacher)
    {
        userTeacher.setUpdateTime(DateUtils.getNowDate());
        return userTeacherMapper.updateUserTeacher(userTeacher);
    }

    /**
     * 批量删除老师
     * 
     * @param ids 需要删除的老师主键
     * @return 结果
     */
    @Override
    public int deleteUserTeacherByIds(Long[] ids)
    {
        return userTeacherMapper.deleteUserTeacherByIds(ids);
    }

    /**
     * 删除老师信息
     * 
     * @param id 老师主键
     * @return 结果
     */
    @Override
    public int deleteUserTeacherById(Long id)
    {
        return userTeacherMapper.deleteUserTeacherById(id);
    }
}
